local Actor = import(".Actor")
local Creature = class("Creature",Actor)
local Armature = require("app.public.avatar.Armature")

function Creature:ctor(params)
    Creature.super.ctor(self,params)
end

function Creature:showTomb(b)
	if b then
		if not self._tombNode then
			local node = Armature.create({path=Res.BattleTombArmaturePath,armatureName=Res.BattleTombArmatureName,animationName="",skeletonName=Res.BattleTombArmatureName})
			if node then
				self:addChild(node)
			end
			self._tombNode = node
		end
		if self._tombNode then
			self._tombNode:playAni({name="dead",fadeInTime=0})
		end
	else
		if self._tombNode then 
			self._tombNode:playAni({name="alive",fadeInTime=0,completeCallback=function() 
				self._tombNode:removeFromParent()
				self._tombNode = nil
			end})
		end
	end
end

return Creature